<style>
#sign-head { box-sizing:border-box; width:100%;display:inline-block; vertical-align:middle; border-bottom:1px solid gainsboro; background-image:linear-gradient(to bottom,#fff,#eee)}
#sign-head img {height:1.4em;vertical-align:middle}
#sign-head form {font-size: 14px;text-align:right}
#sign-head input[type="text"], #sign-head input[type="password"] {box-sizing:border-box;margin:0 3px;padding:0 2px;width:4.8em;height:1.75em;border:1px solid #ccc;border-radius:3px}
#sign-head button {font-size:11px;line-height:11px;padding:6px 8px}
#sign-head .button-likeText {position:absolute;padding:5px 9px;right:3px;top:1px}
#sign-head .position-anchor {line-height:22px}
</style>
<script>
setTimeout(function(){
if (window['message-top']==='密码验证错误，请检查用户名/密码'||window['message-top']==='没有找到用户'||window['message-top']==='此项操作需先登录'){
document.querySelector('#sign-head>div>div:nth-child(2)>button:nth-child(2)').onclick();
document.querySelector('#sign-head img[src="<%- rootUrl %>/res/question.svg"]').style.animation="flash-icon 2s";
}},3500);
function navBtnClick(obj){
let doactive=obj.style.color=='';let statId=0;
obj.style.color = doactive?'orange':'';
obj.parentNode.querySelectorAll('button').forEach((b,i)=>{if(b==obj){statId=i+1}else{b.style.color=''}});
document.querySelectorAll('#sign-head>div>div:nth-child(1)>*').forEach((d,i)=>d.style.display=(i==(doactive?statId:0)?'':'none'));
}
</script>
<div id="sign-head">
<div class="width-limit childs-padding-arround adapt-panel" >
<div style="padding-right:0;flex-grow:1">
    <a href="./"><img src="<%- rootUrl %>/res/alljs48.ico" /></a>
    <form class="common-style" action="./search.html" style="display:none">
        <div class="position-anchor">
            <button class="button-likeText" type="submit"><i class="fa fa-search"></i></button>
            <input name="text" type="search" placeholder="搜一下" style="vertical-align:unset;height:1.8em;width:15em;margin:0;padding-right:2.5em" />
        </div>
    </form>
    <form method="post" action="./<%- signined ? 'signout' : 'signin' %>" style="display:none">
        <div class="position-anchor" style="font-size:14px">
            <button class="button-likeText" type="submit"><i class="fa fa-<%- signined ? 'sign-out' : 'sign-in' %>"></i></button>
            <% if (signined) { %><span style="padding-right:2.5em">欢迎回来, <%- username %></span><% } else { %>用户<input type="text" name="name" placeholder="/邮箱/手机">&nbsp;密码<input type="password" name="password" style="padding-right:2.5em"><% } %>
        </div>
        <a href="./signAbout.html" style="padding:6px;margin-left:-6px"><i class="fa fa-question"></i></a>
    </form>
</div>
<div>
    <button onclick="navBtnClick(this)"><i class="fa fa-search"></i></button>
    <button onclick="navBtnClick(this)" style="margin-left:-3px"><i class="fa fa-<%- signined ? 'user' : 'sign-in' %>"></i></button>
</div>
</div>
</div>